#include "xService.h"
#include "xConsole.h"
namespace xNet
{
    xService::xService(std::string strIp,uint16 wPort)
                      : m_strIp(strIp)
                      , m_wPort(wPort)
                      , m_bTermination(false)
    {
    }

    void xService::Main()
    {
        if(!Init())
        {
            return ;
        }
        console::Show();
        while(!m_bTermination)
        {
            if(!ServiceCallBack())
            {
                break;
            }
        }
    }
    void xService::Finish()
    {
        m_bTermination = true;
    }
}